<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" 
	xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<ui:include src="include/head.xhtml" />
</h:head>
<h:body>
	<ui:include src="include/header.xhtml" />
	<div class="main">
		<table width="100%">
			<tr>
				<td width="15%" valign="top">
					<ui:include src="include/menu.xhtml" />
				</td>
				<td class="main" valign="top">
					<h:form>
						<table width="100%">
						<tr>
							<td valign="top" width='30%'>
								Выберите отчет:
								<br />
								<h:dataTable value="#{reportsBean.reports.items}" var="r" binding="#{reportsBean.reports.dataTable}">
									<h:column>
										<a class="#{reportsBean.reports.style}" 
										   href="http://localhost:8080/university-web/reports/#{r.id}/">#{r.title}</a>
									</h:column>
								</h:dataTable>
								
								<h:panelGroup rendered="#{reportsBean.teachersMode}">
									<br />
									<br />
									Выберите преподавателя:
									<br />
									<h:dataTable value="#{reportsBean.teachers.items}" var="t" binding="#{reportsBean.teachers.dataTable}">
										<h:column>
											<a class="#{reportsBean.teachers.style}" 
											   href="http://localhost:8080/university-web/reports/#{reportsBean.reports.id}/#{t.id}">#{t.name}</a>
										</h:column>
									</h:dataTable>
								</h:panelGroup>
								
								<h:panelGroup rendered="#{reportsBean.spMode}">
									<br />
									<br />
									Выберите Специальность:
									<br />
									<h:dataTable value="#{reportsBean.specialities.items}" var="s" binding="#{reportsBean.specialities.dataTable}">
										<h:column>
											<a class="#{reportsBean.specialities.style}" 
											   href="http://localhost:8080/university-web/reports/#{reportsBean.reports.id}/#{s.id}">#{s.title}</a>
										</h:column>
									</h:dataTable>
								</h:panelGroup>
							</td>
							<td valign="top">
								<table width="100%">
									<thead>
										<ui:repeat value="#{reportsBean.headers}" var="h">
											<th style='border: 1px solid black;'>#{h}</th>
										</ui:repeat>
									</thead>
									<ui:repeat value="#{reportsBean.rows}" var="row">
										<tr>
											<ui:repeat value="#{row}" var="c">
												<td style='border: 1px solid black;'>
													#{c}
												</td>
											</ui:repeat>
										</tr>
									</ui:repeat>
								</table>
							</td>
						</tr>
						</table>
					</h:form>
					<h:messages />
					<br />
				</td>
			</tr>
		</table>
	</div>
</h:body>
</html>